package cn.lovelysia.ymcc.enumcode;

/*枚举类 封装异常类型*/
public enum  GlobalErrorCode {
    /**系统异常**/
    SYSTEM_ERROR("2001","系统内部异常"),

    /**请求参数异常**/
    PARAM_ERROR("3001","请求参数异常"),

    /**未知异常**/
    UNKNOWN_ERROR("4001","系统异常，请稍后重试"),

    /**未知异常**/
    BUSINESS_ERROR("5001","");

    //错误码
    private String code;
    //错误信息
    private String message;

    GlobalErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "GlobalErrorCode{" +
                "code='" + code + '\'' +
                ", message='" + message + '\'' +
                '}';
    }
}
